import myFns from '@/utils/myFns'

// Vuex对象
const admin = {
    state() {
        return {
            asideOpen: true
        }
    },
    getters: {
        getAsideOpen: state => {
            return state.asideOpen
        },
    },
    mutations: {
        // 使用方法 this.$store.commit('updateAsideOpenMutations', false)
        updateAsideOpenMutations (state, val) {
            state.asideOpen = val
        }
    },
    actions: {
        toggleAsideOpen ({ commit, state }) {
            myFns.clog('Store > admin > actions > toggleAsideOpen', !state.asideOpen)
            if (state.asideOpen) {
                commit('updateAsideOpenMutations', false)
            } else {
                commit('updateAsideOpenMutations', true)
            }
        },
        
    }
}


export default admin